﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO.Ports;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MDK.Common
{
    public class FingerPrint
    {
        private static UInt32 N_ADDR = 0XFFFFFFFF;//设备地址
        private static Bitmap bmp = new Bitmap(256, 288);//指纹图片
        private static SerialPort ComPort;
        private static IntPtr DeviceHandle = IntPtr.Zero;

        //public static bool OpenDevice()
        //{
        //    ComPort = new SerialPort();
        //    ComPort.ReadTimeout = 5000;
        //    ComPort.PortName = SerialPort.GetPortNames()[0];
        //    ComPort.BaudRate = 115200;
        //    ComPort.DataBits = 8;
        //    ComPort.StopBits = (StopBits)Enum.ToObject(typeof(StopBits), 1);
        //    ComPort.Parity = (Parity)Enum.ToObject(typeof(Parity), 0);
        //    try
        //    {
        //        ComPort.Open();
        //        int result = DriveOpration.PSOpenDeviceEx(ref DeviceHandle, DriveOpration.DEVICE_UDisk, DriveOpration.COM1, DriveOpration.BAUD_RATE_57600, 2, 0);
        //        if (DeviceHandle == IntPtr.Zero || result != 0)
        //        {
        //            ComPort.Close();
        //        }
        //        else
        //        {
        //            return true;
        //        }
        //        return false;
        //    }
        //    catch (Exception ex)
        //    {
        //        return false;
        //    }
        //}

        public static void InputFingerPrint()
        {

        }

        public static void SearchFingerPrint()
        {


        }
    }
}
